<?php session_start(); ?>
<!DOCTYPE HTML>
<html>
	
<head>
	<title>Stewie's Market</title>
	<link rel="stylesheet" href="cs2102.css">
</head>
<div class="container">
<body>

	<!-- Site navigation menu -->
	<?php include 'nav.php'; 

	function init_db()
	{
		// Open database connection
		$dbHost = "sid3.comp.nus.edu.sg";
		$dbHostPort="1521";
		$dbServiceName = "sid3.comp.nus.edu.sg";
		$usr = "A0103863";
		$pswd = "cs2102std";
		$dbConnStr = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$dbHost.")(PORT=".$dbHostPort."))(CONNECT_DATA=(SERVICE_NAME=".$dbServiceName.")))";
		$dbConn = oci_connect($usr,$pswd,$dbConnStr);

		if(!$dbConn)
		{
			$err = oci_error();
			print('Could not establish a database connection: ' . $err['message']);
		}
		return $dbConn;
	}
	//print "<p><a href='search.php'>Go back</a></p>";
	print "<br><FORM><INPUT Type='button' VALUE='Back' onClick='history.go(-1);return true;'></FORM>";
	$student = $_GET['sender']; // name of the sender
	$time = $_GET['time'];
	$subject = $_GET['subject'];
	$body = $_GET['body'];
	$matric = $_GET['matric']; // receiver's matrix -> if reply, it gets to sender matric
	
	print "<h1></b>".$subject."</h1>";
	print "<b>Time Received:  ".$time."</b>";
	print "<p><b>Sender: </b>".$student."</p>";
	print $body."<br>";
	
	?>
  
  <br>
  <form action="message.php" method="get">
 		 <input type="hidden" name="matric" value=<?php echo $matric;?>>
    	 <input type="hidden" name="receiver" value=<?php echo $student; ?>>
  		<input type="submit" value="Reply">
  </form>
  <!-- does it make a button? How should I link it to message.php! -- >

	<!-- Sign and date the page, it's only polite! -->
	<address>Made by Project group 31 for CS2102, NUS 2013.</address>
</div>

</body>
</div>
</html>